<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/comm/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="${ctx}/img/favicon.ico">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css">

    <script src="${ctx}/layui/layui.js"></script>

</head>
<body class="childrenBody" style="font-size: 12px;">
<form class="layui-form layui-form-pane">
    <input id="examineId" name="examineId" type="hidden" value="${requestScope.examineId}">

    <input id="shipNo" name="shipNo" type="hidden" value="${requestScope.shipNo}">

    <input id="examineType" name="examineType" type="hidden" value="${requestScope.examineType}">

    <input id="optType" name="optType" type="hidden" value="${requestScope.optType}">

    <div class="layui-form-item">
        <div class="layui-input-block" style="margin-left: 0px;">
            <input style="height: 150px;" type="text" class="layui-input" name="rejectDesc"
                   lay-verify="required|userName"
                   maxlength="150"
                   placeholder="请输入拒绝原因">
        </div>
    </div>
    <div class="layui-form-item" style="text-align: center;">
        <button class="layui-btn" lay-submit="" lay-filter="ok">确定</button>
        <button type="layui-btn" id="cancle" class="layui-btn layui-btn-primary">取消</button>

    </div>
</form>
<script type="text/javascript">
    layui.config({
        base: "${ctx}/js/"
    }).use(['form', 'layer', 'jquery', 'common'], function () {
        var $ = layui.jquery,
            form = layui.form(),
            common = layui.common,
            layer = parent.layer === undefined ? layui.layer : parent.layer;

        /**保存*/
        form.on("submit(ok)", function (data) {
            var pageFlag = $("#pageFlag").val();
            var userSaveLoading = top.layer.msg('数据提交中，请稍候', {icon: 16, time: false, shade: 0.8});
            $.ajax({
                url: '${ctx}/rest/ma/examine',
                type: 'post',
                async: false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                data: JSON.stringify(data.field),
                success: function (data) {
                    if (data.resultCode == 0) {
                        top.layer.close(userSaveLoading);
                        common.cmsLaySucMsg("操作成功")
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭                        //刷新父页面
                        parent.location.reload();
                    } else {
                        top.layer.close(userSaveLoading);
                        common.cmsLayErrorMsg(data.resultMsg);
                    }
                }, error: function (data) {
                    top.layer.close(index);

                }
            });
            return false;
        });
        //取消
        $("#cancle").click(function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        });

    });

</script>
</body>
</html>